home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Draw / Sources / DrawPrxy.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.1 KB  |  182 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DrawPrxy.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef DRAWPRXY_H
  13. #define DRAWPRXY_H
  14.  
  15. #ifndef BASESHP_H
  16. #include "BaseShp.h"
  17. #endif
  18.  
  19. #ifndef BOUNDSHP_H
  20. #include "BoundShp.h"
  21. #endif
  22.  
  23. #ifndef LINESHP_H
  24. #include "LineShp.h"
  25. #endif
  26.  
  27. #ifndef OVALSHP_H
  28. #include "OvalShp.h"
  29. #endif
  30.  
  31. #ifndef RECTSHP_H
  32. #include "RectShp.h"
  33. #endif
  34.  
  35. #ifndef RRECTSHP_H
  36. #include "RRectShp.h"
  37. #endif
  38.  
  39. #ifndef TEXTSHP_H
  40. #include "TextShp.h"
  41. #endif
  42.  
  43. // ----- Part Layer -----
  44.  
  45. #ifndef FWFRMING_H
  46. #include "FWFrming.h"
  47. #endif
  48.  
  49. #ifndef FWPROXY_H
  50. #include "FWProxy.h"
  51. #endif
  52.  
  53. // ----- OpenDoc Includes -----
  54.  
  55. #ifndef SOM_ODShape_xh
  56. #include <Shape.xh>
  57. #endif
  58.  
  59. //========================================================================================
  60. // Forward Declaration
  61. //========================================================================================
  62.  
  63. class ODFrame;
  64. class ODTransform;
  65. class CDrawPart;
  66. class CDrawFrame;
  67.  
  68. //========================================================================================
  69. //    class CProxyShape
  70. //========================================================================================
  71.  
  72. class CProxyShape : public CRectShape, public FW_MProxy
  73. {
  74.  public:
  75.     FW_DECLARE_CLASS
  76.     FW_DECLARE_AUTO(CProxyShape)
  77.     
  78. //----------------------------------------------------------------------------------------
  79. //    Initialization/Destruction
  80. //
  81. public:
  82.     CProxyShape(Environment* ev, const FW_CRect& rect, CDrawPart* drawPart);
  83.     CProxyShape(Environment* ev, CDrawPart* drawPart, FW_CReadableStream& archive);
  84.  
  85.     virtual ~CProxyShape();
  86.     
  87. //----------------------------------------------------------------------------------------
  88. //    Inherited API from FW_MProxy
  89. //
  90. public:
  91.     virtual void                 UsedShapeChanged(Environment* ev, 
  92.                                     FW_CEmbeddingFrame* embeddingFrame, 
  93.                                     ODFrame* odEmbeddedFrame);
  94.     
  95.     virtual ODShape*            FrameShapeRequested(Environment* ev, 
  96.                                     FW_CEmbeddingFrame* embeddingFrame, 
  97.                                     ODFrame* odEmbeddedFrame, 
  98.                                     ODShape* requestedFrameShape);
  99.                                             
  100.     virtual short                CreateFacets(Environment* ev,
  101.                                     FW_CEmbeddingFrame* embeddingFrame,
  102.                                     ODFacet* embeddingFacet,
  103.                                     ODFrame* embeddedFrame,
  104.                                     ODShape* proposedClipShape);
  105.                                             
  106.     virtual FW_Boolean            NeedFacets(Environment *ev, 
  107.                                     FW_CEmbeddingFrame* embeddingFrame) const;
  108.                                     
  109.     virtual FW_Boolean            Reveal(Environment *ev, 
  110.                                        FW_CEmbeddingFrame* embeddingFrame,
  111.                                        ODFrame* embeddedFrame, 
  112.                                        ODShape* revealShape);
  113.                                     
  114. //----------------------------------------------------------------------------------------
  115. //    Inherited API from CRectShape and CBaseShape
  116. //
  117. public:
  118.     virtual void         Removed(Environment* ev);
  119.     virtual void        Deleted(Environment* ev);
  120.     virtual void        RestoreShape(Environment *ev);                
  121.  
  122.     virtual void         RenderShape(Environment* ev, ODFacet* facet, FW_CGraphicContext& gc);
  123.  
  124.     virtual void        SubtractToWorkingClip(Environment *ev, 
  125.                                             CDrawFacetClipper* facetClipper, 
  126.                                             ODFacet* containingFacet, 
  127.                                             ODShape* workingClip,
  128.                                             ODShape* tempShape,
  129.                                             ODShape* limitShape);
  130.     
  131.     virtual void        OffsetShape(Environment *ev, FW_Fixed xDelta, FW_Fixed yDelta);
  132.     virtual void        MapShape(Environment *ev, const FW_CRect& srcRect, const FW_CRect& dstRect);
  133.     
  134.     virtual void         SelectShape(Environment *ev, FW_Boolean state);
  135.  
  136.     virtual void        ChangeRenderVerb(Environment *ev, unsigned short renderVerb);
  137.     
  138.     virtual void        AdjustRectForPenSize(FW_CRect& rect, FW_Fixed penSize) const;
  139.  
  140.     // ----- z-Order -----
  141.     virtual void         MovedAfter(Environment *ev, CBaseShape* shape);
  142.     virtual void         MovedBefore(Environment *ev, CBaseShape* shape);
  143.     virtual void         MovedFirst(Environment *ev);
  144.     virtual void         MovedLast(Environment *ev);
  145.     
  146.     // ----- Frozen -----
  147.     virtual FW_Boolean    SetFrozen(FW_Boolean state);
  148.     virtual FW_Boolean     IsFrozen() const;
  149.  
  150.     // ----- Archiving -----
  151.     virtual void        Flatten(FW_CWritableStream& archive);    
  152.     static void*         Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  153.  
  154.     // ----- Linking -----
  155.     virtual void        SetSubscribeLink(Environment* ev, 
  156.                             CDrawSubscribeLink *subscribeLink);
  157.     virtual void        SetPublishLink(Environment* ev, 
  158.                             CDrawPublishLink *subscribeLink);
  159.     virtual FW_Boolean    IsInLinkDestination(Environment* ev);
  160.  
  161.     // ----- Purge -----
  162.     virtual void        MakePurgeable(Environment* ev, CDrawFrame* drawFrame, const FW_CRect& bounds);
  163.                                             
  164. //-----------------------------------------------------------------------------------------
  165. //    New API
  166. //
  167. public:
  168.     void                 MoveBefore(Environment* ev, CProxyShape* before);
  169.     void                 MoveBehind(Environment* ev, CProxyShape* behind);
  170.     
  171.     FW_CRect            GetFrameRect(Environment*) const {return fFrameRect;}
  172.  
  173. //----------------------------------------------------------------------------------------
  174. //    Data Member
  175. //
  176. private:
  177.     FW_Boolean            fFrozen;
  178.     FW_CRect            fFrameRect;        // cached frame Rect
  179. };
  180.  
  181. #endif
  182.